import { createRouter, createWebHistory } from 'vue-router'
import home from '@/views/home/home.vue'
import index from '@/views/home/index.vue'
import cla from '@/views/home/cla.vue'
import cart from '@/views/home/cart.vue'
import my from '@/views/home/my.vue'
import search from '@/views/search.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
          path: '/', redirect: '/home/index' 
    },
    {
      path: '/home',
      component: home,children:[
            {
      path: 'index',
      component: index,
    },
        {
      path: 'cla',
      component: cla,
    },
        {
      path: 'cart',
      component: cart,
    },
        {
      path: 'my',
      component: my,
    },
      ]
    },
    {
      path: '/search',
      component: search,
    },
  ],
})

export default router
